/*
 * WindowController.h
 *
 *  Created on: 06/11/2012
 *      Author: san
 */

#ifndef WINDOWCONTROLLER_H_
#define WINDOWCONTROLLER_H_
#include <gtkmm/window.h>
#include <gtkmm/statusbar.h>
#include <glibmm.h>
#include "ButtonPanelController.h"
#include "Nivel.h"
#include "LevelView.h"
#include <string>
#include <vector>
#include "Dibujable.h"

class WindowController {
private:
	Gtk::Window *window;
	ButtonPanelController *dpc;
	LevelView *lv;
	ButtonPanelController *tpc;
	Gtk::Statusbar *statusbar;

	enum State {NONE, ADDSTATE, REMOVESTATE, MOVESTATE} state;
	Dibujable *selected;
	Nivel nivel;
	std::list<Dibujable *> dibujables;
	void refreshScreen();
	void onCajaButtonClick();
	void onCerditoButtonClick();
	void onRemoveButtonClick();
	bool onLevelClick(GdkEventButton *button);
	bool onDropClick(GdkEventButton *button, Drop *drop);
	void changeState(State state);
public:
	WindowController(Gtk::Window *window, ButtonPanelController *dpc, LevelView *lv, ButtonPanelController *tpc, Gtk::Statusbar *statusbar);
	virtual ~WindowController();
};

#endif /* WINDOWCONTROLLER_H_ */
